<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/App_Master/MasterPage.master"
    CodeFile="interviewGrid.aspx.cs" Title="View All Interviews" Inherits="interviewGrid"
    Theme="Web20CSS" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Skin="Web20" runat="server"
            Height="75px" Width="75px">
        </telerik:RadAjaxLoadingPanel>
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AllowSorting="True"
            AutoGenerateColumns="False" AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True"
            DataSourceID="LinqDataSource1" GridLines="None" ShowGroupPanel="True" Skin="Web20"
            AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True">
            <GroupPanel Visible="True" ID="GroupPanel" Style="width: 100%;">
            </GroupPanel>
            <ExportSettings>
                <Pdf FontType="Subset" PaperSize="Letter"></Pdf>
                <Excel Format="Html"></Excel>
            </ExportSettings>
            <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
            <ClientSettings AllowDragToGroup="True">
                <Selecting AllowRowSelect="True"></Selecting>
            </ClientSettings>
            <MasterTableView CommandItemDisplay="Top" Frame="Border" Dir="LTR" DataSourceID="LinqDataSource1"
                CurrentResetPageIndexAction="SetPageIndexToFirst" TableLayout="Auto" DataKeyNames="InterviewID">
                <EditFormSettings>
                    <EditColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType">
                    </EditColumn>
                </EditFormSettings>
                <Columns>
                    <telerik:GridDateTimeColumn ForceExtractValue="None" DataField="InterviewDate" DataType="System.DateTime"
                        UniqueName="InterviewDate" CurrentFilterFunction="NoFilter" SortExpression="InterviewDate"
                        FilterListOptions="VaryByDataType" DataFormatString="{0:d}" HeaderText="InterviewDate">
                    </telerik:GridDateTimeColumn>
                    <telerik:GridBoundColumn ReadOnly="True" ForceExtractValue="None" DataField="InterviewID"
                        DataType="System.Int32" UniqueName="InterviewID" CurrentFilterFunction="NoFilter"
                        SortExpression="InterviewID" FilterListOptions="VaryByDataType" Visible="False"
                        HeaderText="InterviewID">
                    </telerik:GridBoundColumn>
                    <telerik:GridDropDownColumn ListTextField="CompanyName" ForceExtractValue="None"
                        ListValueField="ApplicationID" DataField="ApplicationID" DataType="System.Int32"
                        UniqueName="ApplicationID" CurrentFilterFunction="NoFilter" SortExpression="ApplicationID"
                        FilterListOptions="VaryByDataType" HeaderText="Company Name" DataSourceID="LinqDataSource2"
                        DropDownControlType="DropDownList">
                    </telerik:GridDropDownColumn>
                    <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="City" FilterListOptions="VaryByDataType"
                        ForceExtractValue="None" HeaderText="City" UniqueName="column">
                    </telerik:GridBoundColumn>
                    <telerik:GridCheckBoxColumn ForceExtractValue="None" DataField="Rejected" DataType="System.Boolean"
                        UniqueName="Rejected" CurrentFilterFunction="NoFilter" SortExpression="Rejected"
                        FilterListOptions="VaryByDataType" HeaderText="Rejected">
                    </telerik:GridCheckBoxColumn>
                    <telerik:GridCheckBoxColumn ForceExtractValue="None" DataField="Offer" DataType="System.Boolean"
                        UniqueName="Offer" CurrentFilterFunction="NoFilter" SortExpression="Offer" FilterListOptions="VaryByDataType"
                        HeaderText="Offer">
                    </telerik:GridCheckBoxColumn>
                    <telerik:GridCheckBoxColumn ForceExtractValue="None" DataField="Pending" DataType="System.Boolean"
                        UniqueName="Pending" CurrentFilterFunction="NoFilter" SortExpression="Pending"
                        FilterListOptions="VaryByDataType" HeaderText="Pending">
                    </telerik:GridCheckBoxColumn>
                        <telerik:GridTemplateColumn UniqueName="notesColumn" HeaderText="Notes">
                            <ItemTemplate>
                                <asp:Label ID="lblNotes" runat="server" Text='<%# Eval("Notes") %>'>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="tbNotes" Height="200px" Width="200px" runat="server" TextMode="MultiLine"
                                    Text='<%# Bind("Notes") %>'></asp:TextBox>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                </Columns>
                <ExpandCollapseColumn Visible="False" Resizable="False" CurrentFilterFunction="NoFilter"
                    FilterListOptions="VaryByDataType">
                    <HeaderStyle Width="20px"></HeaderStyle>
                </ExpandCollapseColumn>
                <RowIndicatorColumn Visible="False" CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType">
                    <HeaderStyle Width="20px"></HeaderStyle>
                </RowIndicatorColumn>
            </MasterTableView>
            <FilterMenu Skin="Web20" EnableTheming="True">
                <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
            </FilterMenu>
        </telerik:RadGrid>
    </telerik:RadAjaxPanel>
    <br />
    <br />
    <div>
        <asp:CheckBox ID="CheckBox1" Text="Export only data" runat="server"></asp:CheckBox>
        <br />
        <asp:CheckBox ID="CheckBox2" Text="Ignore paging (exports all pages)" runat="server">
        </asp:CheckBox>
        <br />
        <asp:CheckBox ID="CheckBox3" Text="Open exported data in new browser window" runat="server">
        </asp:CheckBox>
        <br />
        <br />
        <asp:Button ID="Button1" Width="150px" Text="Export to Excel" OnClick="Button1_Click"
            runat="server"></asp:Button>&nbsp;
        <asp:Button ID="Button2" Width="150px" Text="Export to Word" OnClick="Button2_Click"
            runat="server"></asp:Button>
        <asp:Button ID="Button3" Width="150px" Text="Export to CSV" OnClick="Button3_Click"
            runat="server"></asp:Button>
    </div>
    <br />
    <asp:LinqDataSource ID="LinqDataSource2" runat="server" ContextTypeName="CareerPathDataContext"
        OrderBy="CompanyName" Select="new (ApplicationID, CompanyName)" TableName="cp_Applications">
    </asp:LinqDataSource>
    <br />
    <br />
    <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="CareerPathDataContext"
        EnableDelete="True" EnableInsert="True" EnableUpdate="True" OrderBy="InterviewDate"
        TableName="cp_Interviews">
    </asp:LinqDataSource>
</asp:Content>
